class Solution {
        //创建一个数组先
        List<String> out = new ArrayList<>();
        StringBuilder b = new StringBuilder();
    public List<String> generateParenthesis(int n) {
        add(0,0,n);
        return out;

    }
    public void add(int left ,int right ,int n){
        if(left == n && right== n){
            out.add(b.toString());
            return;
        }

        if(left > n || left < right ) return;
        b.append("(");
        add(left + 1,right,n);
        b.deleteCharAt(b.length()-1);
        b.append(")");
        add(left,right +1 ,n);
        b.deleteCharAt(b.length()-1);
    }
}

public class MainClass {
    public static String stringListToString(List<String> stringList) {
        StringBuilder sb = new StringBuilder("[");
        for (String item : stringList) {
            sb.append(item);
            sb.append(",");
        }
    
        sb.setCharAt(sb.length() - 1, ']');
        return sb.toString();
    }
    
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = in.readLine()) != null) {
            int n = Integer.parseInt(line);
            
            List<String> ret = new Solution().generateParenthesis(n);
            
            String out = stringListToString(ret);
            
            System.out.print(out);
        }
    }
}